<!--
 * @Author: duchengdong
 * @Date: 2021-12-21 16:39:07
 * @LastEditors: duchengdong
 * @LastEditTime: 2021-12-30 20:59:44
 * @Description: 
-->
<script>
import {checkUpdateVersion} from './request/login'
import AuthProvider from './request/AuthProvider.js'
export default {
	onLaunch: async function () {
		console.log('app-onLaunch')
		const accessToken = this.$utils.getStorage('accessToken')
		if (accessToken == 'wait') {
			// 当accessToken是wait的时候，删除token，保证接口请求正常
			this.$utils.removeStorage('accessToken')
		}
		// 相当于做登录
		let token = await AuthProvider.getAccessToken()
		//检查新版本
		checkUpdateVersion()
	},
	onShow: function () {
		console.log('App Show')
	},
	onHide: function () {
		console.log('App Hide')
	},
}
</script>

<style lang="scss">
@import 'uview-ui/index.scss'; //引用uview-ui框架样式
@import 'styles/index.scss'; //引用自定义变量
@import 'styles/uview.scss'; //引用修改的uview-ui自定义养殖

// 在小程序中，不支持通配符*
page,
view,
image {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	outline: none;
}

page {
	background: $bg-color;
}
scroll-view {
	-webkit-overflow-scrolling: touch;
}

@font-face {
	font-family: DIN-Medium-Bold;
	src: url('~@/static/font/DIN-Medium.ttf');
}

@font-face {
	font-family: Gotham-Bold;
	src: url('~@/static/font/Gotham-Bold 700.otf');
}
</style>
